Skip to content

GH-49269: [Python][Docs] Add code examples for compute function first/last/first_last#49270

Merged
AlenkaF merged 7 commits into
apache:mainfrom
zhengruifeng:doc_first_last
Mar 5, 2026
Merged

GH-49269: [Python][Docs] Add code examples for compute function first/last/first_last#49270
AlenkaF merged 7 commits into
apache:mainfrom
zhengruifeng:doc_first_last

Conversation

@zhengruifeng
Copy link
Copy Markdown
Contributor

@zhengruifeng zhengruifeng commented Feb 13, 2026

Rationale for this change

To improve python documentation

What changes are included in this PR?

Add code examples for compute function first/last/first_last

Are these changes tested?

Yes, doc-test

Are there any user-facing changes?

Yes, doc-only changes

@github-actions
Copy link
Copy Markdown

⚠️ GitHub issue #49269 has been automatically assigned in GitHub to PR creator.

@zhengruifeng
Copy link
Copy Markdown
Contributor Author

@github-actions crossbow submit preview-docs

@github-actions
Copy link
Copy Markdown

Revision: 2491b6b

Submitted crossbow builds: ursacomputing/crossbow @ actions-f89059f9d7

Task Status
preview-docs GitHub Actions

>>> pc.first_last(arr3, options=pc.ScalarAggregateOptions(min_count=4))
<pyarrow.StructScalar: [('first', None), ('last', None)]>

See Also
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@github-actions github-actions Bot added awaiting committer review Awaiting committer review and removed awaiting review Awaiting review labels Feb 13, 2026
@zhengruifeng
Copy link
Copy Markdown
Contributor Author

@AlenkaF @kou would you mind taking a look? thanks

Copy link
Copy Markdown
Member

@kou kou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

Comment thread python/pyarrow/_compute_docstrings.py Outdated

Using ``skip_nulls`` to handle null values.

>>> arr2 = pa.array([1.0, 2.0, 3.0, None])
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about using None as the first element?

Suggested change
>>> arr2 = pa.array([1.0, 2.0, 3.0, None])
>>> arr2 = pa.array([None, 2.0, 3.0, None])

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sounds good, let me adjust the examples

@github-actions github-actions Bot added awaiting merge Awaiting merge awaiting review Awaiting review awaiting committer review Awaiting committer review and removed awaiting committer review Awaiting committer review awaiting review Awaiting review awaiting merge Awaiting merge labels Feb 27, 2026
@kou
Copy link
Copy Markdown
Member

kou commented Feb 28, 2026

@github-actions crossbow submit preview-docs

@github-actions
Copy link
Copy Markdown

Revision: 304af83

Submitted crossbow builds: ursacomputing/crossbow @ actions-29ab51c673

Task Status
preview-docs GitHub Actions

@zhengruifeng
Copy link
Copy Markdown
Contributor Author

@github-actions crossbow submit preview-docs

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Mar 3, 2026

Revision: 518498c

Submitted crossbow builds: ursacomputing/crossbow @ actions-6711c06e15

Task Status
preview-docs GitHub Actions

Copy link
Copy Markdown
Member

@AlenkaF AlenkaF left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @zhengruifeng! This is very useful!

@AlenkaF
Copy link
Copy Markdown
Member

AlenkaF commented Mar 5, 2026

Will merge, the failing CI build is not connected.

@AlenkaF AlenkaF merged commit bf8d175 into apache:main Mar 5, 2026
16 of 17 checks passed
@AlenkaF AlenkaF removed the awaiting committer review Awaiting committer review label Mar 5, 2026
@conbench-apache-arrow
Copy link
Copy Markdown

After merging your PR, Conbench analyzed the 3 benchmarking runs that have been run so far on merge-commit bf8d175.

There were no benchmark performance regressions. 🎉

The full Conbench report has more details. It also includes information about 4 possible false positives for unstable benchmarks that are known to sometimes produce them.

@zhengruifeng zhengruifeng deleted the doc_first_last branch March 6, 2026 01:43
thisisnic pushed a commit to thisisnic/arrow that referenced this pull request Apr 6, 2026
… first/last/first_last (apache#49270)

### Rationale for this change
To improve python documentation

### What changes are included in this PR?
Add code examples for compute function first/last/first_last

### Are these changes tested?
Yes, doc-test

### Are there any user-facing changes?
Yes, doc-only changes

* GitHub Issue: apache#49269

Authored-by: Ruifeng Zheng <ruifengz@apache.org>
Signed-off-by: AlenkaF <frim.alenka@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants